<template>
    <div style="height:50px;line-height:50px;border-bottom:1px solid #ccc;display: flex; ">
      <div style="width:200px; padding-left: 30px; font-weight: bold; color: deepskyblue;">后台管理 </div>
      <!-- <span >{{this.data[0].title}}</span> -->
      <div style="flex:1"></div>
      <div style="width:200px;">{{this.data[0].title}} </div>
      <div style="width:100px;" >
        
        <el-dropdown>
          <span class="el-dropdown-link">
            {{user.userName}}<i class="el-icon-arrow-down el-icon--right"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            
            <el-dropdown-item @click.native="$router.push('./login')">退出系统</el-dropdown-item>
  
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>
    
  </template>
  
  <script>
  export default {
    name:"Header",
    props:['user'],

    data() {
      return {
        currentPage:1,
        rows:1,
        data:{},
        
        user:JSON.parse(sessionStorage.getItem('user')),
      }
    },
    mounted () { 
      let userStr = sessionStorage.getItem("user") || "{}"
      this.user = JSON.parse(userStr)
      this.load()
    },
    methods: {
      load(){
              this.$Ajax.get("getNoticeInfo",{
                params:{
                  
                  type:'紧急公告',
                }
              })
              .then(res =>{
              console.log(res.data.rows),
              this.data = res.data.rows
              console.log(this.data[0].title);
              console.log(this.title);
              this.title = this.data[0].title
              })
      },
    },
      

  }
  </script>
  
  <style>
  
  </style>